<?php
namespace Home\Controller;
use Think\Controller;
/**
* 登录控制器
*/
class LoginController extends Controller{
	public function index(){
		if (IS_POST) {

            $name = 'aaa';//I('aaa');
            $pwd  = '123456';//I('123456');
            $data = M('user')->where(array('username'=>$name,'password'=>md5($pwd)))->find();
            if ($data) {
                session('uid',$data);
                $this->success('登录成功');
            }else{
                $this->error('账号密码不匹配');
            }
        }else{
             $this->display();
        }
	}
}